package com.itCar.base.tools.excel;

import lombok.Data;

import java.util.Map;

/**
 * @ClassName TestUser
 * @Description TODO
 * @Author liuzhiguo
 * @Date 2024/8/24 9:03
 * @Version 1.0
 */
@Data
public class TestUser {

    private Integer rowNum;

    @ExcelImport(value = "姓名", required = true, unique = true)
    private String name;
    @ExcelImport("年龄")
    private String age;
    @ExcelImport(value = "性别", kv = "1-男;2-女")
    private String sex;
    @ExcelImport(value = "电话", maxLength = 11, required = true)
    private String tel;
    @ExcelImport("城市")
    private String city;
    @ExcelImport("头像")
    private String avatar;
    @ExcelImport("车牌号")
    private String carNo;

    /**原始数据**/
    private String rowData;
    /**错误数据**/
    private String rowTips;

    public TestUser(){}
    public TestUser(Map map) {
        this.name = (map.get("姓名") == null) ? "" : map.get("姓名").toString();
        this.age = (map.get("年龄") == null) ? "" : map.get("年龄").toString();
        this.sex = (map.get("性别") == null) ? "" : map.get("性别").toString();
        this.tel = (map.get("电话") == null) ? "" : map.get("电话").toString();
        this.city = (map.get("城市") == null) ? "" : map.get("城市").toString();
        this.avatar = (map.get("头像") == null) ? "" : map.get("头像").toString();
        this.carNo = (map.get("车牌号") == null) ? "" : map.get("车牌号").toString();
    }
}
